﻿CREATE TABLE [dbo].[User] (
    [Id]                                     INT            IDENTITY (1, 1) NOT NULL,
    [IsDeleted]                              BIT            NOT NULL,
    [CreatedDate]                            DATETIME       NOT NULL,
    [ModifiedDate]                           DATETIME       NOT NULL,
    [CompanyId]                              INT            NULL,
    [UserName]                               NVARCHAR (256) NOT NULL,
    [Mobile]                                 NVARCHAR (16)  NULL,
    [Email]                                  NVARCHAR (256) NULL,
    [Password]                               NVARCHAR (128) NOT NULL,
    [PasswordQuestion]                       NVARCHAR (256) NULL,
    [PasswordAnswer]                         NVARCHAR (128) NULL,
    [FirstName]                              NVARCHAR (32)  NULL,
    [LastName]                               NVARCHAR (32)  NULL,
    [IsApproved]                             BIT            NOT NULL,
    [IsLockedOut]                            BIT            NOT NULL,
    [LastLoginDate]                          DATETIME       NULL,
    [LastPasswordChangedDate]                DATETIME       NULL,
    [LastLockoutDate]                        DATETIME       NULL,
    [FailedPasswordAttemptCount]             INT            NOT NULL,
    [FailedPasswordAttemptWindowStart]       DATETIME       NULL,
    [FailedPasswordAnswerAttemptCount]       INT            NOT NULL,
    [FailedPasswordAnswerAttemptWindowStart] DATETIME       NULL,
    [LastActivityDate]                       DATETIME       NULL,
    [RoleId]                                 INT            NOT NULL
);



